package cn.yangliu.logback;

import ch.qos.logback.classic.net.SimpleSocketServer;
import org.springframework.core.io.ClassPathResource;

public class LogbackServerApplication {
    public static void main(String[] args) throws Exception {
        run(args);
    }

    public static void run(String[] args) {
        try {
            if (args == null || args.length != 0) {
                String port = "54321";
                ClassPathResource classPathResource = new ClassPathResource("logback-server.xml");
                String[] defaulArgs = {port, classPathResource.getFile().getAbsolutePath()};
                args = defaulArgs;
            }
            SimpleSocketServer.main(args);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }

    }


}
